<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="itcast" uri="http://itcast.cn/common/"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>咨询</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/reset1.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/index.css">

<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/style3.css" />
<script src="${pageContext.request.contextPath }/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.min.js" ></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/indexseo.js" ></script>
<script src="${pageContext.request.contextPath }/js/slider.js"></script>
<script src="${pageContext.request.contextPath }/js/navChange.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.validate.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/messages_zh.js" ></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.cookie.js"></script>
<script type="text/javascript">
var E3MALL = {
		checkLogin : function(){
			var _ticket = $.cookie("token");
			if(!_ticket){
				return ;
			}
			$.ajax({
				url : "${pageContext.request.contextPath }/user/token/" + _ticket,
				dataType : "jsonp",
				type : "GET",
				success : function(data){
					if(data.status == 200){
						var username = data.data.username;
						/* alert("hello"+username); */
						/* var html = username + "，欢迎您！<a href=\"http://www.e3mall.cn/user/logout.html\" class=\"link-logout\">[退出]</a>"; */
						var html = "<div class='navbar-right' style='display: inline-block;padding-top: 10px;'>"+
				          "<div class=''>"+
				          	"<ol class='list-inline'>"+
				          		"<li>欢迎您,<font style='color: red;'>"+username+"</font></li>|"+
				          		"<li><a href='${pageContext.request.contextPath}/user/logout/"+_ticket+"' class='link-logout'>[退出]</a></li>"+
				          	"</ol>"+
				          "</div>"+
				          "</div>";
						$("#loginbar").html(html);
					}
				}
			});
		}
	}

	$(function(){
		// 查看是否已经登录，如果已经登录查询登录信息
		E3MALL.checkLogin();
	});
</script>
<style>	
  /* Make the image fully responsive */
.carousel-inner img {
     width: 100%;
     height: 100%;
}
</style>
</head>
<body style="overflow-x:hidden">

	<jsp:include page="/WEB-INF/jsp/head.jsp"></jsp:include>
		
		<!--新闻标题列表-->
		<div class="container">
			<div class="col-lg-3">
				
			</div>
			
			<div class="col-lg-6 col-lg-offset-3" style="border: 1px solid #E7E7E7;">
				<div class="row">
					<!--新闻-->
					<div class="col-lg-3">
						<h2>新闻</h2>
					</div>
					
				</div>
				<hr />
				<c:if test="${!empty flag }">
				<h5>共找到<font style="color: red;">${count }</font>条与<font style="color: red;">${word }</font>相关的新闻</h5>
				</c:if>
				<!--新闻列表-->
				<div class="row" style="padding-top: 5px;">
					
					<div class="col-lg-12">
						<%-- <c:forEach var="news" items="${newsList }">
						<div class="row">
							<div class="col-lg-4" style="padding-top: 0px;padding-bottom: 10px;">
								
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${news.id}"><img class="img-responsive" src="${news.image }" style="width: 150px;height: 100px;"/></a>
							</div>
							
							<!--标题-->
							<div class="col-lg-6" style="padding-top: 0px;text-align: left;	">
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${news.id}"><h5>${news.title }</h5></a>
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${news.id}"><p style="height: auto;">${news.desc }</p></a>
								<p>
									<span>${news.created }</span>
									<span style="padding-left: 40px;">${news.writer }</span>
								</p>
							</div>
						</div>
						<hr />
						</c:forEach> --%>
						
						<c:forEach var="newsL" items="${newsListt }">
						<div class="row">
							<div class="col-lg-4" style="padding-top: 0px;padding-bottom: 10px;">
								
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${newsL.id}"><img class="img-responsive" src="${newsL.image }" style="width: 150px;height: 100px;"/></a>
							</div>
							
							<!--标题-->
							<div class="col-lg-6" style="padding-top: 0px;text-align: left;	">
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${newsL.id}"><h5>${newsL.title }</h5></a>
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${newsL.id}"><p style="height: auto;">${newsL.desc }</p></a>
								<p>
									<span>${newsL.created }</span>
									<span style="padding-left: 40px;">${newsL.writer }</span>
								</p>
							</div>
						</div>
						<hr />
						</c:forEach>
					</div>
				</div>
			</div>
			<div class="col-lg-3">
				
			</div>
		</div>

  

   
		
		<div class="" style="margin: auto;"></div>
		<!--底层-->
		<nav class="navbar-fixed-bottom">
			<header class="header" style="background-color: gainsboro;">
		      <div class="container1">
		      	
		        <ul class="nav" style="padding-top: 5px;">
		          <li class="nav" style="display: inline;">
		            <p>CopyRight@201624131105</p>
		          </li>
		        </ul>
		        
		      </div>
		    </header>
		    </nav>
</body>
</html>